package com.example.walletmodule.service.impl;

import com.example.walletmodule.mappers.WalletDao;
import com.example.walletmodule.entity.WalletEntity;
import com.example.walletmodule.service.WalletService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.annotation.Resource;


@Service("walletService")
public class WalletServiceImpl extends ServiceImpl<WalletDao, WalletEntity> implements WalletService {

	@Resource
	private WalletDao walletDao;

  	public int insertWallet(WalletEntity entity){
		  return walletDao.insert(entity);
	}
	public WalletEntity getByUserId(String userId) {
		return walletDao.selectByUserId(userId);
	}

	public Integer updateWallet(WalletEntity wallet) {
		return walletDao.updateByUserId(wallet);
	}
}